home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Utilities / Winter Shell 1.0d2 / Source / Libraries / ApplicationPreferencesLib / ApplicationPreferencesLib.h < prev   
Encoding:
C/C++ Source or Header  |  1994-01-16  |  2.2 KB  |  65 lines  |  [TEXT/KAHL]

  1. #pragma once
  2.  
  3. #include "DrawLib.h"
  4. #include "RadioLib.h"
  5. #include "TextLib.h"
  6.  
  7. /* text preferences */
  8. typedef struct {
  9.     TextKindType kind;            /* kind of text documents to create */
  10.     TextState state;                /* text state */
  11.     Boolean wrap;                    /* true if word wrap is enabled */
  12.     Boolean buffer;                /* true if should buffer keyboard input */
  13.     float margin;                    /* word wrap margin */
  14.     short just;                        /* text justification */
  15. } TextPrefsType;
  16.  
  17. /* units of measure preferences */
  18. typedef struct {
  19.     short id;                        /* id of unit (actually, index to a string) */
  20.     float conversion;                /* multiply by unit to get pixels */
  21.     CStr31 singular;                /* name of unit (e.g., inch) */
  22.     CStr31 plural;                    /* plural name of unit (e.g., inches) */
  23. } UnitsPrefsType;
  24.  
  25. /* document preferences */
  26. typedef struct {
  27.     Rect margin;                    /* margins around page for printing */
  28. } DocumentPrefsType;
  29.  
  30. /* application preferences */
  31. typedef struct {
  32.     TextPrefsType text;            /* text preferences */
  33.     UnitsPrefsType units;        /* units of measure preferences */
  34.     DocumentPrefsType doc;        /* document preferences */
  35. } AppPrefsType;
  36.  
  37. /* preferences window structure */
  38. typedef struct {
  39.     DialogPtr dlg;                    /* dialog for setting preferences */
  40.     AppPrefsType *appPrefs;        /* preferences to set from window */
  41.     Boolean sizeHasUserChoice;    /* true if added user's choice to font size
  42.                                             popup menu */
  43.     struct {
  44.         RadioHandle frameRadio;    /* frame around text settings */
  45.         RadioHandle kindRadio;    /* radio buttons for text document kind */
  46.         RadioHandle wrapRadio;    /* radio buttons for word wrap */
  47.     } text;
  48. } AppPrefsWindowType, *AppPrefsWindowPtr, **AppPrefsWindowHandle;
  49.  
  50. AppPrefsType *AppPrefs(void);
  51. const AppPrefsType *AppPrefsDefaults(void);
  52. AppPrefsWindowHandle AppPrefsBegin(AppPrefsType *appPrefs);
  53. void AppPrefsEnd(AppPrefsWindowHandle prefs);
  54. Boolean AppPrefsWithin(AppPrefsWindowHandle prefs, Point where);
  55. void AppPrefsClicked(AppPrefsWindowHandle prefs, long id);
  56. void AppPrefsRead(AppPrefsType *prefs);
  57. void AppPrefsWrite(const AppPrefsType *prefs);
  58. Boolean AppPrefsMenu(const MenuPickType *pick);
  59. void AppPrefsAdjustMenu(void);
  60. void AppPrefsShow(void);
  61. void AppPrefsHide(void);
  62. void AppPrefsMemoryLow(void);
  63. const /* EventTableType */ void *AppPrefsEventTable(void);
  64. void AppPrefsEventTableRegister(void);
  65.